<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>登  录</span>
    </div>
    <el-form ref="loginUser" :model="loginUser" label-width="80px">
      <el-form-item label="账号">
        <el-input v-model="loginUser.name"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="loginUser.pwd" show-password></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="login">登录</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script>
export default {
  data() {
    return {
      loginUser: {
        name:"12345",
        pwd:"123"
      },
    };
  },
  methods: {
    login() {
      this.$axios.post("/users/login",this.loginUser)
      .then(res=>{
        
        if(res.data.code==200){       
          //this.$message.success(res.data.message);   
          this.$router.push("/index");
        }
      })
      
    },
  },
};
</script>
<style>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box-card {
  margin: 100px auto;
  width: 480px;
}
</style>